#ifndef GRAPHICS__VERTEX_H_
#define GRAPHICS__VERTEX_H_

#include "framework.h"

using namespace poly;

namespace graphics
{

#define V_Type_P  1
#define V_Type_PC 2
#define V_Type_PT 3

void InitVertexDeclarations(D3DDevice m_Device);
void DestroyVertexDeclarations();

/**************************************************
 VERTEX TYPE: V_P | float3 Position
**************************************************/
struct V_P
{
	V_P(float3 v):
		V_Position(v)
	{}

	float3 V_Position;

	static IDirect3DVertexDeclaration9* V_Declaration;
};
/**************************************************
 VERTEX TYPE: V_PC | float3 Position, float3 Color
**************************************************/
struct V_PC
{
	V_PC(float3 v, float3 c):
		V_Position(v),
		V_Color(D3DCOLOR_XRGB((int)c.x, (int)c.y, (int)c.z))
	{}

	float3 V_Position;
	D3DCOLOR V_Color;

	static IDirect3DVertexDeclaration9* V_Declaration;
};
/****************************************************
 VERTEX TYPE: V_PT | float3 Position, float2 Texture
****************************************************/
struct V_PT
{
	V_PT(float3 p, float2 uv):
		V_Position(p),
		V_Texture0(uv)
	{}

	float3 V_Position;
	float2 V_Texture0;

	static IDirect3DVertexDeclaration9* V_Declaration;
};
/****************************************************
 VERTEX TYPE: V_PN | float3 Position, float3 Normal
****************************************************/
struct V_PN
{
	V_PN(float3 p, float3 n):
		V_Position(p),
		V_Normal(n)
	{}

	float3 V_Position;
	float3 V_Normal;
	static IDirect3DVertexDeclaration9* V_Declaration;
};

}/* namespace graphics */
#endif /*GRAPHICS__VERTEX_H*/